package lovemusic.lanou.com.newsmusic.global;

import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import org.xutils.x;

/**
 * 定义一个全局的Application
 * Created by lanouhn on 2016/9/28.
 */
public class MyApplications extends Application{
    //    上下文
    private static Context mContext;
    //    发送消息的handler
    private static Handler mHandler;
    //    主线程
    private static int mainThreadId;

    @Override
    public void onCreate() {
        super.onCreate();
//        初始化xutils
        x.Ext.init(this);
        x.Ext.setDebug(true);
        mContext=getApplicationContext();
        mHandler=new Handler();
        mainThreadId=android.os.Process.myTid();
    }

    public static Context getmContext() {
        return mContext;
    }

    public static Handler getmHandler() {
        return mHandler;
    }

    public static int getMainThreadId() {
        return mainThreadId;
    }




}
